package controller;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import pojo.Item;

@Controller
public class ItemController {

	@RequestMapping("itemList")
	public ModelAndView ItemList() {
		ModelAndView mav = new ModelAndView();
		List<Item> itemList = new ArrayList<Item>();
		itemList.add(new Item(1, "冰箱", 1999.0, new Date(), "质量不错"));
		itemList.add(new Item(2, "冰箱2", 1999.0, new Date(), "质量不错2"));
		itemList.add(new Item(3, "冰箱3", 1999.0, new Date(), "质量不错3"));
		itemList.add(new Item(4, "冰箱4", 1999.0, new Date(), "质量不错4"));
		itemList.add(new Item(5, "冰箱5", 1999.0, new Date(), "质量不错5"));
		mav.addObject("itemList", itemList);
		mav.setViewName("/WEB-INF/jsp/itemList.jsp");
		return mav;
	}
}
